<template>
	<view class="content">
		<view class="adsinfo">
			<image src="../static/img/address.png" mode=""></image>
			{{city}}
		</view>
		<view class="swiperbox">
			
			<swiper    class="swiper" :autoplay="true" :current="currentIndex" :circular="true"  
						 :interval="3000" :duration="500" @change="swierChange">
							<swiper-item class="swiper_item"  v-for="(item,i) in banner" :key="i">
								<image  :src="item.banner" class="slide-image" :class="currentIndex === i?'active':''"></image>
							</swiper-item>
						</swiper>
						<view class="dots">
							<view v-for="(item,index) in banner" :key="index">
								<view :class="{activeindex:currentIndex === index}" class="square"></view>
							</view>
						</view>
		</view>
		<view class="list_warp">
			<view @click="gopage('carRepair/carRepair')" class="list_view">
				<image src="../static/img/guzhang.png" mode=""></image>
				<view class="list_cen">
					<view class="chinse">车载终端报修</view>
					<view class="language">
						ئاپتوموبىلغا ئورنىتىلغان تېرمىنال رېمونت قىلىش
					</view>
				</view>
			</view>
			<view @click="gopage('distribution/index')" class="list_view">
				<image src="../static/img/jiayou.png" mode=""></image>
				<view class="list_cen">
					<view class="chinse">加油配送</view>
					<view class="language">
						ماي قاچىلاش يەتكۈزۈپ بېرىش
					</view>
				</view>
			</view>
			<view @click="gopage('caozuoyuan/mycaozuoyuan')" class="list_view">
				<image src="../static/img/baobei.png" mode=""></image>
				<view class="list_cen">
					<view class="chinse">操作员报备</view>
					<view class="language">
						مەشغۇلاتچى مەلۇم قىلىپ ئەنگە ئالدۇرۇش
					</view>
				</view>
			</view>
			<view  @click="gopage('cartOrderList/cartOrderList')" class="list_view">
				<image src="../static/img/peixun.png" mode=""></image>
				<view class="list_cen">
					<view class="chinse">培训代办</view>
					<view class="language">
						تەربىيىلەش ۋاكالىتەن بېجىرىش
					</view>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	import app from '@/util/api.js'
	export default {
		data() {
			return {
				city: '杭州市',
				currentIndex: 0,
				banner:[],
			}
		},
		onLoad() {
this.getbanner()
		},
		methods: {
swierChange(e){
				this.currentIndex = e.detail.current
			},
			gopage(url){
				app.nto(url)
			},
			getbanner(){
				app.load()
				app.request('index',{}).then(res=>{
					this.banner = res.data.banner
					app.hide()
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	
	
	
	.adsinfo{
		align-items: center;
		padding: 20rpx 31rpx 36rpx;
		display: flex;
		justify-content: flex-end;
		color: #333;
		font-size: 30rpx;
		font-weight: bold;
	}
	.adsinfo image{
		width: 24rpx;
		height: 30rpx;
		margin-right: 20rpx;
	}
	
	.list_warp{
		padding: 0 43rpx;
	}
	.list_view{
		margin-top: 20rpx;
		box-shadow: 0px 0px 16rpx 0px rgba(0, 0, 0, 0.1);
		border-radius: 10rpx;
		padding: 20rpx 38rpx;
		display: flex;
	}
	
	.list_view image{
		width: 92rpx;
		height: 92rpx;
		margin-right: 38rpx;
	}
	.list_cen{
		flex: 1;
	}
	.chinse{
		color: #333;
		font-size: 32rpx;
		font-weight: bold;
	}
	.language{
		margin-top: 26rpx;
		font-family: Adobe Arabic;
		font-weight: bold;
		color: #333333;
		font-size: 24rpx;
	}
			.slide-image {
height: 320rpx;		
	 
			  z-index: 5;
			  opacity: 0.3;
			  transform: scale(0.8);
			
			}
			
			.swiper {
				width:100%;
			  height: 320rpx;
			  padding: 0 40rpx;
			  box-sizing: border-box;
			}
			
			.active {
				width: 100%;
			  opacity: 1;
			  z-index: 10;
			 transform: scale(1);
			  transition: all 0.2s ease-in 0s;
			}
	
		.dots{
			margin-top: 20rpx;
			display: flex;
			justify-content: center;
		}
		.square{
			margin: 0 8rpx;
			width: 19rpx;
			height: 9rpx;
			background: #E5E5E5;
			border-radius: 5rpx;
			transition: all .1s ease-in-out;
		}
		.activeindex{
			width: 29rpx;
			background: #FFC03C;
			transition: all .2s ease-in-out;
		}
</style>
